module MediasHelper


  def generate_html_thumb media    
      image_tag url_for_file_column(media, "file", "thumb")
  end
  
  def generate_html_100 media
    image_tag url_for_file_column(media, "file", "hundred")
  end
  
  # Places pictures first, videos last, and audio in the middle
  def media_sort_helper a, b
    if a.class == b.class
      a.created_at <=> b.created_at
    elsif a.class == Picture || b.class == Video
      -1
    else
      1
    end
  end
end
